JavaScript

mapControl.getRoute Method

Syntax

mapObj.getRoute();

Returns

resultobject

Returns an object containing information about the plotted route. See "Route Object Structure" below for more info.

Description

Returns a route object with information about the route plotted on the Map Control.

Discussion

The route returned may order the waypoints differently than the order they were specified if the optimize route flag is on.

Example

//get a pointer to the map control for variable 'mymap1'
var mapObj = {dialog.object}.getControl('mymap1');

if (mapObj) {
    var r = mapObj.getRoute();
}

Route Object Structure

The route object has the following structure:

{
    start: '', \\starting point
    end: '', \\ending point
    waypoints: {
        original: [], \\waypoints in original order
        plotted: [], \\waypoints in plot order
        order: [] \\array showing numeric index of each plotted waypoint (if the waypoint order has been optimized)
    }
}